package com.geoboard.fragments;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTabHost;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.geoboard.R;

public class BoardContainer extends Fragment {
	
	/**** Members **************************************************/
	private FragmentTabHost mTabHost;
	private String TAG = this.getClass().getSimpleName();
	
	/**** Android Callback Methods *********************************/
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
		Log.d(TAG, "onCreateView()");
		ViewGroup root = (ViewGroup) inflater.inflate(R.layout.frag_board_container, container, false);	
		
        mTabHost = (FragmentTabHost) root.findViewById(android.R.id.tabhost);
        mTabHost.setup(getActivity(), getChildFragmentManager(), R.id.realtabcontent);
        mTabHost.addTab(mTabHost.newTabSpec("map").setIndicator("", getResources().getDrawable(android.R.drawable.ic_dialog_map)),
                BoardMapFrag.class, null);
        mTabHost.addTab(mTabHost.newTabSpec("text").setIndicator("", getResources().getDrawable(android.R.drawable.ic_menu_sort_by_size)),
                BoardTextFrag.class, null);

        return root;		
	}

    @Override
    public void onDestroyView() {
    	Log.d(TAG, "onDestroyView()");
        super.onDestroyView();
        mTabHost = null;
    }
}
